package com.pivotal.cloud.crypto.keygen;

/**
 * @className: com.pivotal.cloud.security.crypto.keygen.KeyGenerators
 * @projectName: PivotalCloud项目
 * @module: PivotalCloud项目-KeyGenerators类，主要位于Security安全模块-Key生成器模块
 * @content: KeyGenerators-Key生成器
 * @author: Powered by Marklin
 * @datetime: 2025-06-24 15:15
 * @version: 1.0.0
 * @copyright: Copyright © 2018-2025 PivotalCloud Systems Incorporated. All rights
 * reserved.
 */
public final class KeyGenerators {

	private KeyGenerators() {
	}

	public static BytesKeyGenerator secureRandom() {
		return new SecureRandomBytesKeyGenerator();
	}

	public static BytesKeyGenerator secureRandom(int keyLength) {
		return new SecureRandomBytesKeyGenerator(keyLength);
	}

	public static BytesKeyGenerator shared(int keyLength) {
		return new SharedKeyGenerator(secureRandom(keyLength).generateKey());
	}

	public static StringKeyGenerator string() {
		return new HexEncodingStringKeyGenerator(secureRandom());
	}

}
